<template>
  <div class="col">
    <h2>评论回复</h2>
    <ul class="list-group">
      <p/>
      <h3 v-show="comments.length === 0">暂无评论，点击左侧占领第一个沙发吧！^_^</h3>
      <Item v-for="(comment,index) in comments" v-bind:comment="comment" :key="index" :index="index"
            :deleteContent="deleteContent"/>
    </ul>
  </div>
</template>

<script>
  import Item from "./Item"

  export default {
    //组件之间的通信
    //方式一：接收标签上绑定的comments属性,以对象的形式接收，指定数据类型
    props: {
      comments: Array,
      deleteContent: Function
    },
    //方式二：接收标签上绑定的comments属性,以数组的形式接收
    // props: [
    //   'comments'，
    // 'deleteContent'
    // ],
    components: {Item}
  }
</script>

<style scoped>

</style>
